package com.project.ds;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.dtyunxi.ds.BaseMapper;
import com.project.entity.area.Area;

@Mapper
public interface AreaMapper extends BaseMapper<Area>{
	
	@Select("SELECT code,name,parentcode,status,level,flag FROM S_AREA WHERE parentcode is null AND status='1' ORDER BY id")
	List<Area> getProvinceList();

	@Select("SELECT code,name,parentcode,status,level,flag FROM S_AREA WHERE parentcode = #{code} and status='1' ")
	List<Area> getChildList(String code);
	
	@Select("SELECT name FROM S_AREA WHERE code = #{code}")
	String getAreaNameByCode(String code);

}
